package com.xsh.gls.service.impl;

import com.xsh.gls.mapper.SalesmanMapper;
import com.xsh.gls.pojo.Salesman;
import com.xsh.gls.service.SalManService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SalManServiceImpl implements SalManService {
    @Autowired
    private SalesmanMapper salesmanMapper;
    @Override
    public Salesman selectByIdCard(String SIDCARD, String oldSIDCARD) throws Exception {
        return salesmanMapper.selectByIdCard(SIDCARD, oldSIDCARD);
    }

    @Override
    public boolean add(Salesman salesman) throws Exception {
        if(salesmanMapper.insertSelective(salesman)==1){
            return true;
        }
        return false;
    }

    @Override
    public List<Salesman> queryarea(String sAddress) throws Exception {
        return salesmanMapper.queryarea(sAddress);
    }
}
